-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query: Adds support for non streaming ORDER BY #4362
Query: Adds support for non streaming ORDER BY #4362
Conversation
I'd avoid 'Static' here #Resolved Refers to: Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs:71 in dd5ae23. [](commit_id = dd5ae23475604edfca950939b757aa0ea313e4dd, deletion_comment = False) |
new lines #Resolved Refers to: Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs:50 in dd5ae23. [](commit_id = dd5ae23475604edfca950939b757aa0ea313e4dd, deletion_comment = False) |
parameters or something else #Resolved Refers to: Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs:110 in dd5ae23. [](commit_id = dd5ae23475604edfca950939b757aa0ea313e4dd, deletion_comment = False) |
this.bufferedPages.Count > 0 #Resolved Refers to: Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs:152 in dd5ae23. [](commit_id = dd5ae23475604edfca950939b757aa0ea313e4dd, deletion_comment = False) |
Consider only using the MultiLevel class #Pending Refers to: Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs:2031 in 4271b86. [](commit_id = 4271b8691ad67e7eb7605b19a5ebd85efad439fc, deletion_comment = False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4271b86
to
d77567d
Compare
...Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Query/OrderByPipelineStageBenchmark.cs
Outdated
Show resolved
Hide resolved
All the other pipeline stages also use inline constants. This code will be invoked in loop, where we may not want to pay the performance cost of doing a resource lookup. I will keep this as is for now. In reply to: 2010479803 Refers to: Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs:1885 in eba9d5a. [](commit_id = eba9d5a, deletion_comment = False) |
…AsyncEnumerator and IAsyncEnumerator
…thereby removing the awkward method SetCancellationToken from IQueryPipelineStage
…for an alternative implementation for non streaming order by
dd5ae23
to
3065ed1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp automerge |
Command 'automerge' is not supported by Azure Pipelines. Supported commands
See additional documentation. |
Description
This change adds support for non streaming ORDER BY. Prior to this, the SDK assumed that the documents returned by the backend in response to ORDER BY queries were totally ordered across continuations. With the addition of non streaming ORDER BY to the backend, this is no longer true. The backend indicates this with a new field in the response body,
_streaming
that will be set tofalse
. In this case, a new non streaming order by pipeline stage is created. This is a blocking pipeline stage similar to GROUP BY. This stage accumulates all backend responses before it yields any results. This stage is exercised only if_streaming
is set to false in the backend response to an ORDER BY query.This change also fixes a few bugs in the SDK code:
The
ResponseLengthInBytes
property ofQueryPage
was being set incorrectly in several pipeline stages and has been removed.The
IQueryPipelineStage
interface had an awkwardSetCancellationToken
method that has been removed in favor of taking theCancellationToken
as a parameter to theMoveNextAsync
method onITracingAsyncEnumerator
instead.The index utilization header was not being accumulated correctly in
SkipEmptyPageQueryPipelineStage
, and similar code inClientAggregateQueryPipelineStage
had an unnecessary allocation in a loop.Type of change
Closing issues
To automatically close an issue: closes #IssueNumber